package com.usian.user.controller;

import com.usian.model.user.dtos.ApUserVo;
import com.usian.model.admin.pojos.AdUser;
import com.usian.user.service.AdUserRegisterService;
import com.usian.api.user.AdUserReisterControllerApi;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 文件名:AdUserRegisterController
 * 创建者: 闫俊涛
 * 创建时间:2022/6/29 11:50
 * 描述:这是一个实例
 */
@RestController
@RequestMapping("/api/user/v1/send")
public class AdUserRegisterController implements AdUserReisterControllerApi {

    @Autowired
    private AdUserRegisterService adUserRegisterService;
   @RequestMapping("/sendCode")
    @Override
    public ResponseResult sendCode(String phone) {
        return  adUserRegisterService.sendCode(phone);
    }

    @RequestMapping("/findByPhone")
    @Override
    public AdUser findByPhone(String phone) {
        return  adUserRegisterService.findByPhone(phone);
    }

    @RequestMapping("/register")
    @Override
    public ResponseResult register(@RequestBody ApUserVo adUserVo) {
        return adUserRegisterService.register(adUserVo);
    }
}
